var app = getApp(), fetchApi = require("../../../utils/httpPost.js")
import Toast from '../../../component/vant/toast/toast';
Page({
  /**
   * 页面的初始数据
   */
  data: {
    imgurl: app.getImgUrl(),
    orderId:0,
    remain_ms:30,
    isLoading:false,
    code: 10000,
    type:0,//wyfee - 物业费缴纳  
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    if(options.type){
      this.data.type = options.type;
      this.setData({
        type: parseInt(options.type)
      })
    }
  },
  /**
   * 获取页面数据的 http请求
   */
  onHttpInit: function (order_id) {
    fetchApi.httpPost('/product/order/detail/pay', {
      order_id: order_id,
    }, function (res) {
      console.log("payresult 订单详情数据", res)
      if (res.data.code == 0) {
        that.data.order_type = res.data.data.order_type
        that.data.orderId = res.data.data.order_id
        that.setData({
          allprice: res.data.data.allprice,
          isLoading: false
        })
      } else {
        Toast.fail(res.data.msg)
      }
    },function(){})
  },
  goIndex:function(){
    wx.switchTab({ url: "/pages/home/home" });
  },
  goOrderList:function(){
    wx.redirectTo({ url: "../order/index" });
  },
})